export const portalData = [
    {
        IP: '202.12.28.131',
        CPU: 1,
        memory: 41,
        IO: 187,
        visit_num: 57,
        success_rate: 95.58,
        visit_test_rate: 98.35,
        response_time: 589,
        health: 45,
        app_test_failure: [
            { visit_time: '18/2/21 上午12:57', response_time: '589ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '21/2/21 上午12:57', response_time: '801ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '27/2/21 上午12:57', response_time: '1514ms', fail_type: 'Non-Existent Domain' },
        ]
    }
];

export const AAAData = [
    {
        IP: '202.12.28.131',
        CPU: 1,
        memory: 41,
        IO: 187,
        visit_num: 57,
        success_rate: 95.58,
        visit_test_rate: 98.35,
        response_time: 589,
        health: 45,
        app_test_failure: [
            { visit_time: '18/2/21 上午12:57', response_time: '589ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '21/2/21 上午12:57', response_time: '801ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '27/2/21 上午12:57', response_time: '1514ms', fail_type: 'Non-Existent Domain' },
        ]
    }
];

export const DHCPData = [
    {
        IP: '202.12.28.131',
        CPU: 1,
        memory: 41,
        IO: 187,
        visit_num: 57,
        success_rate: 95.58,
        visit_test_rate: 98.35,
        response_time: 589,
        health: 45,
        app_test_failure: [
            { visit_time: '18/2/21 上午12:57', response_time: '589ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '21/2/21 上午12:57', response_time: '801ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '27/2/21 上午12:57', response_time: '1514ms', fail_type: 'Non-Existent Domain' },
        ],
        DHCP_IP: [
            { pool_name: 'test', start_IP: '192.168.1.100', end_IP: '192.168.1.200', mask: '255.255.255.0', gateway_addr: '192.168.1.1' }
        ]
    }
];

export const DNSData = [
    {
        IP: '202.12.28.131',
        CPU: 1,
        memory: 41,
        IO: 187,
        visit_num: 57,
        success_rate: 95.58,
        visit_test_rate: 98.35,
        response_time: 589,
        health: 45,
        app_test_failure: [
            { visit_time: '18/2/21 上午12:57', response_time: '589ms', fail_type: 'Non-Existent Domain' },
            { visit_time: '21/2/21 上午12:57', response_time: '801ms', fail_type: 'Server Failure' },
            { visit_time: '27/2/21 上午12:57', response_time: '1514ms', fail_type: 'Request Timed Out' },
            { visit_time: '27/2/21 上午12:57', response_time: '844ms', fail_type: 'Query Refused' },
        ],
        DNS_test_domain: [
            { domain: 'baidu.com', IP: '220.181.57.216'}
        ]
    }
];

export const portalColumns = [
    {
        'title': 'IP',
        'key': 'IP',
        render: (h, params) => {
            return h('a', { domProps: { href: `/#/serviceDevice-detail/portal/${params.row.IP}` } }, params.row.IP);
        }
    },
    {
        'title': 'CPU',
        'key': 'CPU',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.CPU + '%');
        }
    },
    {
        'title': '内存',
        'key': 'memory',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.memory + '%');
        }
    },
    {
        'title': '硬盘IO',
        'key': 'IO',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.IO + ' MB/s');
        }
    },
    {
        'title': '应用测试成功率',
        'key': 'success_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.success_rate + '%');
        }
    },
    {
        'title': '访问测试成功率',
        'key': 'visit_test_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + '%');
        }
    },
    {
        'title': '访问计数器',
        'key': 'visit_num',
        sortable: true,
    },
    {
        'title': '反应时间',
        'key': 'response_time',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + ' ms');
        }
    },
    {
        'title': '健康度',
        'key': 'health',
        sortable: true,
    },
];

export const AAAColumns = [
    {
        'title': 'IP',
        'key': 'IP',
        render: (h, params) => {
            return h('a', { domProps: { href: `/#/serviceDevice-detail/AAA/${params.row.IP}` } }, params.row.IP);
        }
    },
    {
        'title': 'CPU',
        'key': 'CPU',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.CPU + '%');
        }
    },
    {
        'title': '内存',
        'key': 'memory',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.memory + '%');
        }
    },
    {
        'title': '硬盘IO',
        'key': 'IO',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.IO + ' MB/s');
        }
    },
    {
        'title': '认证成功率',
        'key': 'success_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.success_rate + '%');
        }
    },
    {
        'title': '访问测试成功率',
        'key': 'visit_test_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + '%');
        }
    },
    {
        'title': '访问计数器',
        'key': 'visit_num',
        sortable: true,
    },
    {
        'title': '反应时间',
        'key': 'response_time',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + ' ms');
        }
    },
    {
        'title': '健康度',
        'key': 'health',
        sortable: true,
    },
];

export const DHCPColumns = [
    {
        'title': 'IP',
        'key': 'IP',
        render: (h, params) => {
            return h('a', { domProps: { href: `/#/serviceDevice-detail/DHCP/${params.row.IP}` } }, params.row.IP);
        }
    },
    {
        'title': 'CPU',
        'key': 'CPU',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.CPU + '%');
        }
    },
    {
        'title': '内存',
        'key': 'memory',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.memory + '%');
        }
    },
    {
        'title': '硬盘IO',
        'key': 'IO',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.IO + ' MB/s');
        }
    },
    {
        'title': 'DHCP成功率',
        'key': 'success_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.success_rate + '%');
        }
    },
    {
        'title': '访问测试成功率',
        'key': 'visit_test_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + '%');
        }
    },
    {
        'title': '访问计数器',
        'key': 'visit_num',
        sortable: true,
    },
    {
        'title': 'DHCP时间',
        'key': 'response_time',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + ' ms');
        }
    },
    {
        'title': '健康度',
        'key': 'health',
        sortable: true,
    },
];

export const DNSColumns = [
    {
        'title': 'IP',
        'key': 'IP',
        render: (h, params) => {
            return h('a', { domProps: { href: `/#/serviceDevice-detail/DNS/${params.row.IP}` } }, params.row.IP);
        }
    },
    {
        'title': 'CPU',
        'key': 'CPU',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.CPU + '%');
        }
    },
    {
        'title': '内存',
        'key': 'memory',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.memory + '%');
        }
    },
    {
        'title': '硬盘IO',
        'key': 'IO',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.IO + ' MB/s');
        }
    },
    {
        'title': 'DNS成功率',
        'key': 'success_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.success_rate + '%');
        }
    },
    {
        'title': '访问测试成功率',
        'key': 'visit_test_rate',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + '%');
        }
    },
    {
        'title': '访问计数器',
        'key': 'visit_num',
        sortable: true,
    },
    {
        'title': 'DNS时间',
        'key': 'response_time',
        sortable: true,
        render: (h, params) => {
            return h('span', params.row.visit_test_rate + ' ms');
        }
    },
    {
        'title': '健康度',
        'key': 'health',
        sortable: true,
    },
];

export const testColumns = [
    {
        'title': '测试时间',
        'key': 'visit_time',
        sortable: true,
    },
    {
        'title': '反应时间',
        'key': 'response_time',
        sortable: true,
    },
    {
        'title': '故障类型',
        'key': 'fail_type',
        sortable: true,
    },
]

export const DHCPIPColumns = [
    {
        'title': '地址池名称',
        'key': 'pool_name',
    },
    {
        'title': '起始IP',
        'key': 'start_IP',
    },
    {
        'title': '结束IP',
        'key': 'end_IP',
    },
    {
        'title': '子网掩码',
        'key': 'mask',
    },
    {
        'title': '网关地址',
        'key': 'gateway_addr',
    },
]

export const DNSTESTColumns = [
    {
        'title': '域名',
        'key': 'domain',
    },
    {
        'title': 'IP',
        'key': 'IP',
    },
]